home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
avidem
/
mmpform1.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
9KB
|
401 lines
VERSION 2.00
Begin Form Form1
Caption = "MultiMedia Demo in Visual Basic"
ClientHeight = 4950
ClientLeft = 435
ClientTop = 2250
ClientWidth = 7800
Height = 5640
Left = 375
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 4950
ScaleWidth = 7800
Top = 1620
Width = 7920
Begin TextBox Text1
BorderStyle = 0 'None
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 405
Left = 3000
TabIndex = 0
TabStop = 0 'False
Text = "Text1"
Top = 4440
Width = 4215
End
Begin CommandButton Command6
Caption = "EXIT"
Height = 375
Left = 1320
TabIndex = 9
Top = 4440
Width = 735
End
Begin Timer Timer2
Left = 5760
Top = 3840
End
Begin Timer Timer1
Enabled = 0 'False
Left = 5040
Top = 3840
End
Begin CommandButton Command5
Caption = "Resume"
Height = 375
Left = 1800
TabIndex = 8
Top = 3840
Width = 855
End
Begin CommandButton Command4
Caption = "Pause"
Height = 375
Left = 720
TabIndex = 7
Top = 3840
Width = 855
End
Begin CommandButton Command3
Caption = "Close MMP File"
Height = 735
Left = 840
TabIndex = 6
Top = 2640
Width = 1695
End
Begin CommandButton Command8
Caption = "Stop Recorder"
Height = 735
Left = 1920
TabIndex = 10
Top = 1800
Width = 1695
End
Begin CommandButton Command7
Caption = "Start Recorder"
Height = 735
Left = 0
TabIndex = 11
Top = 1800
Width = 1695
End
Begin CommandButton Command2
Caption = "Play MMP File"
Height = 735
Left = 840
TabIndex = 5
Top = 960
Width = 1695
End
Begin FileListBox File1
Height = 2565
Left = 5520
Pattern = "*.mid;*.wav;*.mmm;*.avi"
TabIndex = 3
Top = 720
Width = 1695
End
Begin DirListBox Dir1
Height = 2535
Left = 3720
TabIndex = 1
Top = 720
Width = 1695
End
Begin DriveListBox Drive1
Height = 315
Left = 3720
TabIndex = 2
Top = 120
Width = 1695
End
Begin CommandButton Command1
Caption = "Open MMP File"
Height = 735
Left = 840
TabIndex = 4
Top = 120
Width = 1695
End
Begin Menu About
Caption = "&About"
Begin Menu About1
Caption = "About &MultiMedia Demo"
End
End
End
Sub About1_Click ()
CRLF$ = Chr$(13) + Chr$(10)
Msg$ = "Written by Jerry Turpin" + CRLF$ + "Bedford, VA" + CRLF$ + "(800) 456-7775"
MsgBox (Msg$)
End Sub
Sub Command1_Click ()
Command2.Enabled = 0
Command3.Enabled = 0
Command4.Enabled = 0
Command5.Enabled = 0
Dim i As Integer
A$ = ""
If InStr(TheFile, ".mid") > 0 Then FileType$ = "MUSIC"
If InStr(TheFile, ".wav") > 0 Then FileType$ = "TALK"
If InStr(TheFile, ".mmm") > 0 Then FileType$ = "MOVIE"
If InStr(TheFile, ".avi") > 0 Then FileType$ = "VID"
If FileType$ = "MOVIE" Then
Action$ = "Open " + TheFile + " Type MMMOVIE alias MOVIE"
Else
Action$ = "Open " + TheFile + " alias " + FileType$
End If
i = mciExecute(Action$)
Command2.Enabled = -1
Command3.Enabled = -1
End Sub
Sub Command2_Click ()
Command1.Enabled = Not Command1.Enabled
Dim i As Integer
A$ = ""
If InStr(TheFile, ".mid") > 0 Then FileType$ = "MUSIC"
If InStr(TheFile, ".wav") > 0 Then FileType$ = "TALK"
If InStr(TheFile, ".mmm") > 0 Then FileType$ = "MOVIE"
If InStr(TheFile, ".avi") > 0 Then FileType$ = "VID"
Action$ = "Play " + FileType$
If InStr(TheFile, ".wav") > 0 Then
Open TheFile For Random Shared As #1
Timer2.Enabled = -1
Timer2.Interval = LOF(1) / 11
Rem assumes 11K/sec. .WAV files
Close 1
End If
i = mciExecute(Action$)
Command2.Enabled = 0
Command4.Enabled = -1
End Sub
Sub Command3_Click ()
Dim i As Integer
If InStr(TheFile, ".mid") > 0 Then FileType$ = "MUSIC"
If InStr(TheFile, ".wav") > 0 Then FileType$ = "TALK"
If InStr(TheFile, ".mmm") > 0 Then FileType$ = "MOVIE"
If InStr(TheFile, ".avi") > 0 Then FileType$ = "VID"
Action$ = "Close " + FileType$
i = mciExecute(Action$)
Command2.Enabled = 0
Command3.Enabled = 0
Command4.Enabled = 0
Command5.Enabled = 0
Command1.Enabled = -1
End Sub
Sub Command4_Click ()
Dim i As Integer
If InStr(TheFile, ".mid") > 0 Then FileType$ = "MUSIC"
If InStr(TheFile, ".wav") > 0 Then FileType$ = "TALK"
If InStr(TheFile, ".mmm") > 0 Then FileType$ = "MOVIE"
If InStr(TheFile, ".avi") > 0 Then FileType$ = "VID"
Action$ = "Pause " + FileType$
i = mciExecute(Action$)
If i = 1 Then
Command5.Enabled = -1
Command4.Enabled = 0
End If
End Sub
Sub Command5_Click ()
Dim i As Integer
If InStr(TheFile, ".mid") > 0 Then FileType$ = "MUSIC"
If InStr(TheFile, ".wav") > 0 Then FileType$ = "TALK"
If InStr(TheFile, ".mmm") > 0 Then FileType$ = "MOVIE"
If InStr(TheFile, ".avi") > 0 Then FileType$ = "VID"
Action$ = "Play " + FileType$
i = mciExecute(Action$)
If i = 1 Then
Command4.Enabled = -1
Command5.Enabled = 0
End If
End Sub
Sub Command6_Click ()
Action$ = "Close all"
i = mciExecute(Action$)
End
End Sub
Sub Command7_Click ()
Command1.Enabled = Not Command1.Enabled
Dim i As Integer
Action$ = "Close All"
i = mciExecute(Action$)
Action$ = "Open NEW type waveaudio alias TALK"
i = mciExecute(Action$)
Action$ = "Record Talk"
Timer1.Enabled = -1
Timer1.Interval = 1000
i = mciExecute(Action$)
Command1.Enabled = 0
Command2.Enabled = 0
Command4.Enabled = -1
End Sub
Sub Command8_Click ()
Command1.Enabled = Not Command1.Enabled
Dim i As Integer
Action$ = "Stop Talk"
i = mciExecute(Action$)
Action$ = "SAVE TALK MyDemo.WAV"
i = mciExecute(Action$)
Action$ = "Close Talk"
i = mciExecute(Action$)
Call Dir1_Change
TheFile = "MyDemo.WAV"
Text1.Text = "Recorded File Name is MyDemo.WAV"
Command2.Enabled = 0
Command4.Enabled = -1
End Sub
Sub Dir1_Change ()
ChDir Form1.Dir1.List(Form1.Dir1.ListIndex)
File1.Path = CurDir$
File1.Refresh
End Sub
Sub Drive1_Change ()
ChDrive Form1.Drive1.List(Form1.Drive1.ListIndex)
Dir1.Path = CurDir$
Dir1.Refresh
End Sub
Sub File1_Click ()
TheFile = File1.List(File1.ListIndex)
Command1.Enabled = -1
Text1.Text = TheFile
Action$ = "Close All"
i = mciExecute(Action$)
End Sub
Sub Form_Click ()
Dim i As Integer
A$ = ""
While A$ = ""
A$ = InputBox$("command:", "MCI Input", "close all ")